package com.dl7.mvp.injector.modules;

import com.dl7.mvp.adapter.AlbumsListAdapter;
import com.dl7.mvp.injector.PerFragment;
import com.dl7.mvp.module.base.IBasePresenter;
import com.dl7.mvp.module.video.list.AlbumsListPresenter;
import com.dl7.mvp.module.video.list.AlbumsListFragment;
import com.dl7.recycler.adapter.BaseQuickAdapter;

import dagger.Module;
import dagger.Provides;

/**
 * Created by long on 2016/10/11.
 * 分类对应的所有专辑列表
 */
@Module
public class AlbumsListModule {

    private final AlbumsListFragment mView;
    private AlbumsListAdapter mAdapter;
    private int mCategoryID;

    public AlbumsListModule(AlbumsListFragment view, int categoryId) {
        this.mView = view;
        this.mCategoryID = categoryId;
    }

    @PerFragment
    @Provides
    public IBasePresenter providePresenter() {

        return new AlbumsListPresenter(mView, mCategoryID);
    }

    @PerFragment
    @Provides
    public BaseQuickAdapter provideAdapter() {
        mAdapter = new AlbumsListAdapter(mView.getContext());
        return mAdapter;
    }
}
